<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    请输入你的分数<input class="inp" type="text">
    <button class="btn">查询分数范围</button>
    <script>
        var inp = document.getElementsByClassName("inp")[0];
        var btn = document.getElementsByClassName("btn")[0];
        btn.onclick=function(){
            var res = inp.value;
            if(0<res && res<60){
                alert("不及格")
            }
            else if(60<=res && res<80){
                alert("良好")
            }
            else if(80<=res && res<=100){
                alert("优秀")
            }
            else{
                alert("请输入正确分数")
            }
        }
    </script>
</body>
</html>